<template>
  <div class="container" style="margin: 0; padding: 20px 0;">

	<uni-card padding="20px 0px" style="text-align: center; font-weight: bold; margin: 0 auto;">
	
		    <div style="font-size: 20px; font-weight: bold;">
		      {{ co_name }}
		    </div>
		</uni-card>
	
	<uni-card    v-for="mast in masts">
	<u-cell>
	    <div slot="title" style="display: flex;  flex-direction: column;">
			<div style="display: flex;  flex-direction: row;">
				<u-avatar
				  slot="icon"
				  shape="square"
				  size="25"
				  :src="'/static/images/masts.png'"
				  customStyle="margin-bottom: 5px;margin-right: 8px"
				></u-avatar>
				<span style="font-weight: bold;">
				  排气孔编号
				</span>
			</div>
	      <span>
	        {{ replaceCNSymbols(mast.mast_id) }}
	      </span>
		</div>
	  </u-cell>
	  
	  <u-cell>
	      <div slot="title" style="display: flex;  flex-direction: column;">
	  		<div style="display: flex;  flex-direction: row;">
	  			<u-avatar
	  			  slot="icon"
	  			  shape="square"
	  			  size="25"
	  			  :src="'/static/images/factors.png'"
	  			  customStyle="margin-bottom: 5px;margin-right: 8px"
	  			></u-avatar>
	  			<span style="font-weight: bold;">
	  			  气态特征因子+常规因子
	  			</span>
	  		</div>
	        <span>
	          {{ mast.factors }}
	        </span>
	  	</div>
	    </u-cell>
	
		<u-cell>
		    <div slot="title" style="display: flex;  flex-direction: column;">
				<div style="display: flex;  flex-direction: row;">
					<u-avatar
					  slot="icon"
					  shape="square"
					  size="25"
					  :src="'/static/images/gas.png'"
					  customStyle="margin-bottom: 5px;margin-right: 8px"
					></u-avatar>
					<span style="font-weight: bold;">
					  确定的气态污染物因子
					</span>
				</div>
		      <span>
		        {{ mast.identified_factors }}
		      </span>
			</div>
		  </u-cell>
		  
		  <u-cell>
		      <div slot="title" style="display: flex;  flex-direction: column;">
		  		<div style="display: flex;  flex-direction: row;">
		  			<u-avatar
		  			  slot="icon"
		  			  shape="square"
		  			  size="25"
		  			  :src="'/static/images/ps.png'"
		  			  customStyle="margin-bottom: 5px;margin-right: 8px"
		  			></u-avatar>
		  			<span style="font-weight: bold;">
		  			  备注
		  			</span>
		  		</div>
		        <span>
		          {{ getps(mast.ps) }}
		        </span>
		  	</div>
		    </u-cell>
	
	</uni-card>

  </div>
</template>

<script>
export default {
  data() {
    return {
      co_name: '南京白敬宇制药有限责任公司',
      masts: [
        {
          "id": 1,
          "co_name": "南京白敬宇制药有限责任公司",
          "mast_id": "FQ-01(东经118°47′56″北纬32°16′45″)",
          "identified_factors": [
              "丙酮",
              "乙酸乙酯",
              "乙醇",
              "2-丁酮",
              "甲醇"
          ],
          "factors": [
              "丙酮",
              "乙酸乙酯",
              "乙醇",
              "2-丁酮",
              "甲醇"
          ],
          "ps": null,
          "hasTorch": true
        },
        {
          "id": 1,
          "co_name": "南京白敬宇制药有限责任公司",
          "mast_id": "FQ-02(东经118°48′44″北纬32°16′44″)",
          "identified_factors": [
              "乙酸乙酯",
              "甲醇",
              "丙酮",
              "乙醇"
          ],
          "factors": [
              "乙酸乙酯",
              "甲醇",
              "丙酮",
              "乙醇"
          ],
          "ps": null,
          "hasTorch": true
        },
        {
          "id": 1,
          "co_name": "南京白敬宇制药有限责任公司",
          "mast_id": "FQ-03(东经118°48′44″北纬32°16′44″)",
          "identified_factors": [
              "乙酸乙酯",
              "丙酮",
              "乙醇",
              "HCl"
          ],
          "factors": [
              "乙酸乙酯",
              "丙酮",
              "乙醇",
              "HCl"
          ],
          "ps": null,
          "hasTorch": true
        },
        {
          "id": 1,
          "co_name": "南京白敬宇制药有限责任公司",
          "mast_id": "FQ-04(东经118°48′26″北纬32°16′64″)",
          "identified_factors": [
              "丙酮",
              "HCl",
              "乙酸乙酯",
              "乙醇"
          ],
          "factors": [
              "丙酮",
              "HCl",
              "乙酸乙酯",
              "乙醇"
          ],
          "ps": null,
          "hasTorch": true
        },
        {
          "id": 1,
          "co_name": "南京白敬宇制药有限责任公司",
          "mast_id": "FQ-05(东经118°48′20″北纬32°16′64″)",
          "identified_factors": [
              "乙酸乙酯",
              "甲醇",
              "丙酮",
              "乙醇",
              "甲醛",
              "NH3",
              "H2S",
              "丁酮"
          ],
          "factors": [
              "乙酸乙酯",
              "甲醇",
              "丙酮",
              "乙醇",
              "甲醛",
              "NH3",
              "H2S",
              "丁酮"
          ],
          "ps": null,
          "hasTorch": true
        }],
		mergeList: []

    };
  },
  onLoad() {
	uni.showToast({
		title: "企业级身份验证成功",
		icon: "none"
	});
  },
  methods: {

  	clickCompany(company) {
  		console.log(company._id);
  		company.expanded = !company.expanded;
  	},
  	replaceCNSymbols(str) {
  	  // 使用 replace 函数，将中文符号替换为英文符号
  	  let result = str.replace(/，/g, ',')
  					 .replace(/（/g, '(')
  					 .replace(/）/g, ')')
  					 .replace(/【/g, '[')
  					 .replace(/】/g, ']')
  					 .replace(/‘/g, "\'")
  					 .replace(/“/g, "\"")
  					 .replace(/”/g, "\"")
  					 .replace(/’/g, "\'");
  	  // 返回处理过后的字符串
  	  return result;
  	},
  	getps(str){
  		if(str == "" || str == null || str == undefined)return "无";
  		else return str;
  	}
  }
};
</script>

<style>

.container{
	/* background-color: #3C9CFF; */
	
	background: linear-gradient(to bottom right,#6190E8, #A7BFE8);	
}



</style>
